<?php

class Filter_TableEndsWith {

	var $sEndsWithString;
	
	function Filter_TableEndsWith( $sEndsWithString ){
		$this->sEndsWithString = trim( strtoupper( $sEndsWithString ) );
	}

	function ShouldIncludeTable( $sTableName ) {

		if ( empty( $this->sEndsWithString ) ) return true;

		$sTableName = trim( strtoupper( $sTableName ) );
		
		$sLengthOfSearch = strlen( $this->sEndsWithString );
		$sLengthOfTable  = strlen( $sTableName );

		return ( substr( $sTableName, ( $sLengthOfTable - $sLengthOfSearch ) ) === $this->sEndsWithString );
	}
}


?>